package mapproviderapi;

public class MapTileBound {
	private int top;

	private int left;
	
	private int width;
	
	private int height;
	
	public int getTop() {
		return top;
	}

	public void setTop(int top) {
		this.top = top;
	}

	public int getLeft() {
		return left;
	}

	public void setLeft(int left) {
		this.left = left;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public MapTileBound(){
		
	}
	
	public MapTileBound(int top, int left, int width, int height){
		this.top = top;
		this.left = left;
		this.height = height;
		this.width = width;
	}
	
	@Override
	public int hashCode(){
		final int prime = 31;
		int result = 1;
		
		result *= prime + top;
		result *= prime + left;
		result *= prime + height;
		result *= prime + width;	
		
		return result;
	}
	
	@Override
	public boolean equals(Object obj){
		if (this == obj){
			return true;
		}
		
		if (obj == null){
			return false;
		}
		
		if (this.getClass() !=  obj.getClass()){
			return false;
		}
		
		MapTileBound other = (MapTileBound) obj;
		
		if (top != other.top){
			return false;
		}
		if (left != other.left){
			return false;
		}
		if (width != other.width){
			return false;
		}
		if (height != other.height){
			return false;
		}
		
		return true;
		
	}
}
